package cn.shop.ordersystem.controller;

import cn.shop.ordersystem.mapper.OrdersMapper;
import cn.shop.ordersystem.pojo.vo.OrderDetailVO;
import cn.shop.ordersystem.pojo.vo.OrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/order")
public class FTorderController {
    @Autowired(required = false)
    OrdersMapper mapper;
    @RequestMapping("/select")
    public List<OrderVO> select(){
        return mapper.select();
    }
    @RequestMapping("/selectOrderById")
    public List<OrderDetailVO> selectOrderById(int id){
        System.out.println(mapper.selectOrderById(id));
        return mapper.selectOrderById(id);
    }
}
